package com.example.leo.mycharmingstudent.mvp.source;

import com.example.leo.mycharmingstudent.a0917.practice.ArticleEntity;
import com.example.leo.mycharmingstudent.mvp.source.remote.MVPTasksRemoteDataSource;

/**
 * Created by Leo on 2020/11/10.
 */

public class MVPTasksRepository implements IMVPTasksDataSource {
    private static MVPTasksRepository INSTANCE = null;

    private final IMVPTasksDataSource mTasksRemoteDataSource;

    @Override
    public void articleList(int currentPage, NetCallBack<ArticleEntity> netCallBack) {
        mTasksRemoteDataSource.articleList(currentPage, netCallBack);
    }

    private MVPTasksRepository(IMVPTasksDataSource remoteDataSource) {
        mTasksRemoteDataSource = remoteDataSource;
    }

    public static MVPTasksRepository getInstance(MVPTasksRemoteDataSource remoteDataSource) {
        if (INSTANCE == null) {
            INSTANCE = new MVPTasksRepository(remoteDataSource);
        }
        return INSTANCE;
    }
}
